<?php


namespace Before\Prototype;


class Client
{
    public static function main()
    {
        $product = new Product();
        $product_assign = new Product();

        var_dump(compact('product', 'product_assign'));

        $product->widget->id = -1;
        var_dump(compact('product', 'product_assign'));
    }
}


class Product
{
    public Widget $widget;

    public function __construct()
    {
        $this->widget = new Widget();
    }
}


class Widget
{
    public int $id;

    public function __construct()
    {
        $this->id = mt_rand(0, PHP_INT_MAX);
    }
}


Client::main();
